package com.ruoyi.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum FieldType {

    VARCHAR("varchar"),
    INT("int"),
    LONG("long"),
    BIGINT("bigint"),
    CHAR("char"),
    DATETIME("datetime"),
    TEXT("text");

    private String type;

    public static FieldType getFieldType(String type) {
        for (FieldType value : values()) {
            if (value.type.equals(type)) {
                return value;
            }
        }
        return VARCHAR;
    }
}
